<?php
/* Description: This file is used to add sub sub category. */
#########IncludeFiles####################################################################################
include_once '../inc/config.php';
include_once("../inc/bootstrape.php");
require_once _SITE_PATH_.'classes/Vendor/Vendor.php';
require_once _SITE_PATH_.'classes/Master/Master.php';
require_once _SITE_PATH_.'classes/CommonUtility/CommonUtility.php';

$tableName = 'unit_master';
$uniqueColum = 'title';
$moduleName = 'master';
$manageScript = 'unit_mng.php';
$currentPage = 'unit_edit.php';
$_tplName = 'master/unit_edit.tpl';
$_title = 'Edit Attribute Unit';

$id = trim($_REQUEST['id']);
$result = CommonUtility::getDataById($id, $tableName);    

if( $_POST['submit']=='Submit'){   
	$parms['id'] = $_POST['id'];
	$parms['title'] = $_POST['title'];
	$parms['description'] = $_POST['description'];
	$parms['modified'] = date('Y-m-d'); 
	$condition['id'] = $parms['id'];
	
    if( CommonUtility::updateData($parms, $tableName, $condition)) {
        header("Location: $manageScript"."?msg=106");            
        exit;
    }
    $err = 107;    
}

$editor = CommonUtility::includeEditor();

if( $errMsg ){
    $result = $_POST;
}
$errMsg = $err;
require_once _ADMIN_TPL_MAIN_;
?>